home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / input.zip / DEMOINPU.PAS < prev    next >
Pascal/Delphi Source File  |  1993-01-04  |  3KB  |  93 lines

  1. Program DemoInputUnit;
  2.  
  3. Uses
  4.    Crt, InputUn;
  5.  
  6. var
  7.    InKey     : char;
  8.    AnyString : string;
  9.    AnyInt    : longint;
  10.    AnyNum    : real;
  11.    Escape    : boolean;
  12.  
  13. begin
  14.    ClrScr;
  15.    writeln;
  16.    Inverse;
  17.    writeln(' Text in Inverse mode ');
  18.    writeln;
  19.    Underline;
  20.    writeln(' Text in Underline mode ( if using a monochrome monitor)');
  21.    writeln;
  22.    normal;
  23.    writeln(' Back to normal ');
  24.    writeln;
  25.    writeln(' The GoBack procedure is used...(press any key)................ ');
  26.    Inkey:=readkey;
  27.    goback;
  28.    writeln(' To erase a line and write a new one  (press any key) ');
  29.    InKey:=readkey;
  30.    ClrScr;
  31.    writeln(' The ReadString function takes 3 parameters');
  32.    writeln(' Function ReadString( Prompt : string; width : byte; var Escape : boolean )');
  33.    writeln('                                                                    : string;');
  34.    writeln(' Prompt is the string that is first put into the edit field.');
  35.    writeln(' This is the string that the function returns if the function is exited with');
  36.    writeln(' an Esc at any time, or a return while it is there.');
  37.    writeln(' This prompt may be edited if the right arrow or the insert key is pressed');
  38.    writeln(' on the first input, otherwise the prompt will disappear.  The return key ');
  39.    writeln(' will input all the visible characters in the field and exit the function.');
  40.    writeln(' The Del, left and right arrow keys work as does the backspace.');
  41.    writeln(' The Ins key toggles the insert mode where new characters are inserted ');
  42.    writeln(' instead of written over.  It is initially off.');
  43.    writeln(' Esc will also exit the function, return the prompt as the result and set ');
  44.    writeln(' the Escape parameter to true (otherwise set to false with a return');
  45.    writeln(' the width parameter sets the maximum length of the string');
  46.    writeln(' This field is highlighted in Inverse. It may be turned off by setting the');
  47.    writeln(' InverseOn to true. Another Global varible that affects this function is');
  48.    writeln(' ValidCharSet which is initially set to the set of all printable characters.');
  49.    writeln(' You can change it before calling this function, and is reset to the ');
  50.    writeln(' DefaultSet const after calling it.  The InverseOn varible will convert');
  51.    writeln(' all letters to uppercase if set to true. It is initially set to false');
  52.    writeln;
  53.    repeat
  54.       write('Input a string->');
  55.       AnyString:=ReadString('This is your prompt',20,escape);
  56.       writeln;
  57.       goback;
  58.       if escape
  59.          then write(' Escape Exit  ');
  60.       writeln('Your string is ''',AnyString,'''');
  61.       inkey:=readkey;
  62.       goback;
  63.       write('Input an integer ( ReadInt )->');
  64.       AnyInt:=ReadInt(123,5,Escape);
  65.       writeln;
  66.       goback;
  67.       if escape
  68.          then write(' Escape Exit  ');
  69.       writeln('Your integer is ',AnyInt);
  70.       if escape then exit;
  71.       inkey:=readkey;
  72.       goback;
  73.       write('Input a real number ( ReadNum )->');
  74.       AnyNum:=ReadNum(1.23,8,escape);
  75.       writeln;
  76.       goback;
  77.       if escape
  78.          then write(' Escape Exit  ');
  79.       writeln('Your Number is ',AnyNum:0:5);
  80.       if escape then exit;
  81.       if not escape
  82.          then begin
  83.             Inkey:=readkey;
  84.             goback;
  85.          end;
  86.    until escape;
  87. end.
  88.  
  89.  
  90.  
  91.  
  92.  
  93.